#ifndef _SPRH2d_H_
#define _SPRH2d_H_

#include <iostream>
#include <stdio.h>
#include <cv.h>


using namespace std;

typedef pair<float,float> P2d;

struct SPRHfeature
{
  int sn;
  float *val;
};

class SPRH2d
{
public:
  SPRH2d(int _div,float _rmax);
  ~SPRH2d();

  void setRmax(float rm) { rmax = rm; };
  void proc(const vector< pair<P2d,P2d> > flows);
  int getHnum(void) { return hnum; };
  float *getHistogram(int *hn) { *hn = hnum; return hist; };
  void getHistVec(vector<float> *sprhHist);

private:
  int div,hnum;
  float *hist;
  float rmax;
  void make3Dfeature(const pair<P2d,P2d> f1,
		     const pair<P2d,P2d> f2,
		     float p[3]);
};

#endif

